package com.yunhe.log.client;

import com.yunhe.log.client.fallback.AuthorityFallbackFactory;
import com.yunhe.common.model.ResultObject;
import com.yunhe.common.model.authority.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 权限Feign客户端
 * @author liuronglei
 */
@FeignClient(value = "authority", fallbackFactory = AuthorityFallbackFactory.class)
@Component
public interface AuthorityClient {

    /**
     * 根据条件获得用户列表
     * @param userId   用户ID
     */
    @RequestMapping(value = "/users/{userId}", method = RequestMethod.GET)
    ResponseEntity<ResultObject<User>> getUserById(@PathVariable("userId") Long userId);
}